package sdfi.lee.Entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the rolltype table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="rolltype"
 */

public abstract class BaseRolltype  implements Serializable {

	public static String REF = "Rolltype";
	public static String PROP_TYPENAME = "typename";
	public static String PROP_TYPENAMECN = "typenamecn";
	public static String PROP_ID = "id";


	// constructors
	public BaseRolltype () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseRolltype (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String typename;
	private java.lang.String typenamecn;

	// collections
	private java.util.Set<sdfi.lee.Entity.Character> characters;
	private java.util.Set<sdfi.lee.Entity.Rollnotice> rollnotices;


	public java.util.Set<sdfi.lee.Entity.Rollnotice> getRollnotices() {
		return rollnotices;
	}

	public void setRollnotices(java.util.Set<sdfi.lee.Entity.Rollnotice> rollnotices) {
		this.rollnotices = rollnotices;
	}

	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: typename
	 */
	public java.lang.String getTypename () {
		return typename;
	}

	/**
	 * Set the value related to the column: typename
	 * @param typename the typename value
	 */
	public void setTypename (java.lang.String typename) {
		this.typename = typename;
	}



	/**
	 * Return the value associated with the column: typenamecn
	 */
	public java.lang.String getTypenamecn () {
		return typenamecn;
	}

	/**
	 * Set the value related to the column: typenamecn
	 * @param typenamecn the typenamecn value
	 */
	public void setTypenamecn (java.lang.String typenamecn) {
		this.typenamecn = typenamecn;
	}



	/**
	 * Return the value associated with the column: characters
	 */
	public java.util.Set<sdfi.lee.Entity.Character> getCharacters () {
		return characters;
	}

	/**
	 * Set the value related to the column: characters
	 * @param characters the characters value
	 */
	public void setCharacters (java.util.Set<sdfi.lee.Entity.Character> characters) {
		this.characters = characters;
	}

	public void addTocharacters (sdfi.lee.Entity.Character character) {
		if (null == getCharacters()) setCharacters(new java.util.TreeSet<sdfi.lee.Entity.Character>());
		getCharacters().add(character);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof sdfi.lee.Entity.Rolltype)) return false;
		else {
			sdfi.lee.Entity.Rolltype rolltype = (sdfi.lee.Entity.Rolltype) obj;
			if (null == this.getId() || null == rolltype.getId()) return false;
			else return (this.getId().equals(rolltype.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}